Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

271
Vistas
"getWatchLength" is not defined on the instance but referenced during render. Make sure to declare reactive data vue js properties in the data option

I've a vuex store which stores the state of the length of watched products, I get the length of product in my store but each time I try to {{getWatchlength}} in my code i get "getWatchlength" not defined

This the error I get in my console https://imageshack.com/i/pmlnoX9nj

This my vuex store https://imageshack.com/i/pmP87O5Ij I'm getting the length in my store

This my html code

<template>
  <div id="app">
    {{ getWatchLength }}
    <router-view></router-view>
  </div>
</template>

My script tag

<script>
import { mapActions } from "vuex";
import { mapGetters } from "vuex";
export default {
  name: "app",
  data() {
    return {
      categoryID: null,
      categories: [],
      products: [],
      show: null
    };
  },
  computed: {
    ...mapGetters( ["getWatchLength"], ["isLoggedIn"])
  }
};
</script>

Please, I don't know what I'm doing wrong

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try like following:

import { mapGetters, mapActions } from 'vuex';

computed: {
  ...mapGetters(["getWatchLength", "isLoggedIn"])
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda